package org.esky;

import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.Scanner;

public class T6_Client {
	public static void main(String[] args) throws UnknownHostException,
			IOException {
		Socket socket = new Socket("127.0.0.1", 1111);
		OutputStream os = socket.getOutputStream();
		PrintWriter pw = new PrintWriter(os, true);

		Scanner sc = new Scanner(System.in);
		while (true) {
			System.out.println("请输入消息：");
			String info = sc.next();
			if (info != null) {
				if (info.equals("end")) {
					break;
				}
				pw.println(info);
			}
		}
	}
}